package com.sanyue.codingsettlement.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.sanyue.codingsettlement.model.dto.team.TeamQueryRequest;
import com.sanyue.codingsettlement.model.entity.Team;
import com.sanyue.codingsettlement.model.vo.TeamVO;

import javax.servlet.http.HttpServletRequest;

/**
 * 队伍表服务
 *
 * @author <a href="https://github.com/liyupi">程序员鱼皮</a>
 * @from <a href="https://www.code-nav.cn">编程导航学习圈</a>
 */
public interface TeamService extends IService<Team> {

    /**
     * 校验数据
     *
     * @param team
     * @param add 对创建的数据进行校验
     */
    void validTeam(Team team, boolean add);

    /**
     * 获取查询条件
     *
     * @param teamQueryRequest
     * @return
     */
    QueryWrapper<Team> getQueryWrapper(TeamQueryRequest teamQueryRequest);
    
    /**
     * 获取队伍表封装
     *
     * @param team
     * @param request
     * @return
     */
    TeamVO getTeamVO(Team team, HttpServletRequest request);

    /**
     * 分页获取队伍表封装
     *
     * @param teamPage
     * @param request
     * @return
     */
    Page<TeamVO> getTeamVOPage(Page<Team> teamPage, HttpServletRequest request);
}
